using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Starznet.SharePoint.Utilities;

namespace Starznet.SharePoint.SPDAT.ApplicationPages.Settings
{
    public class ViewListXMLPage : StarznetBaseLayoutPage
    {
        protected Guid oListGuid;
        protected Label LblXML;

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            if (string.IsNullOrEmpty(Request.QueryString.Get("List")))
                throw new ArgumentException("Missing List parameter in page querystring");

            oListGuid = new Guid(Request.QueryString.Get("List"));
            SPList oList = SPContext.Current.Web.Lists[oListGuid];

            LblXML.Text = Utility.TransformXML(oList.SchemaXml);
        }
    }
}
